﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Visit_Type_Maitain.aspx.cs"
    MasterPageFile="~/MasterPage.master" Inherits="CallRoute_Visit_Type_Maitain" %>

<%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>拜访类型维护</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        $(function () {
            var dlg = $('#dd').dialog({
                title: '拜访类型维护',
                iconCls: 'icon-ok',
                closed: true,
                buttons: [{
                    text: '保存',
                    handler: function () {
                        $get('<%=btnSave.ClientID %>').click();
                    }
                }, {
                    text: '取消',
                    handler: function () {
                        $('#dd').dialog('close');
                    }
                }]
            });
            dlg.parent().appendTo(jQuery("form:first"));
        });
        function open1() {
            $('#dd').dialog('open');
        }
        function close1() {
            $('#dd').dialog('close');
        }
    </script>
    <div>
        <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        </asp:ScriptManagerProxy>
        <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table id="wsd_listtable">
                    <tr>
                        <td colspan="6">
                            <asp:GridView QueryName="VisistTypeList" Width="100%" ID="VisistTypeList" runat="server"
                                AutoGenerateColumns="False" BorderWidth="0" OnRowDataBound="Grid_RowDataBound"
                                EmptyDataText="没有可显示的数据." EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                                EnableEmptyContentRender="true" DataKeyNames="ID" AllowPaging="True" PageSize="10"
                                EnableModelValidation="True" OnSelectedIndexChanged="VisistTypeList_SelectedIndexChanged">
                                <HeaderStyle CssClass="titlist" />
                                <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                                <Columns>
                                    <asp:TemplateField HeaderText="编号" ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text='<%# Eval("ID") %>'
                                                OnClientClick="open1();"></asp:LinkButton>
                                        </ItemTemplate>
                                        <ControlStyle Font-Underline="False" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="名称" ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Select"
                                                Text='<%# Eval("Description") %>' OnClientClick="open1();"></asp:LinkButton>
                                        </ItemTemplate>
                                        <ControlStyle Font-Underline="False" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="有效" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                        <ItemTemplate>
                                            <b>
                                                <%# (bool)Eval("ACTIVE") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                </Columns>
                                <RowStyle CssClass="evenline" />
                                <AlternatingRowStyle CssClass="oddline" />
                                <PagerSettings Visible="false" FirstPageText="首页" LastPageText="尾页" Mode="NumericFirstLast"
                                    PageButtonCount="30" />
                            </asp:GridView>
                            <uc1:GridPager ID="GridPager1" runat="server" Visible="false" />
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td style="float: right">
                            <asp:Button ID="btn_add" runat="server" class="wsd_button2" Text="新增" OnClientClick="open1();"
                                CausesValidation="false" OnClick="btn_add_Click" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <div id="dd" icon="icon-save" style="width: 600px; height: 250px; text-align: center;">
            <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                
                    <table id="wsd_inputtable" style="border:0px">
                        <tr>
                            <td colspan="6" >
                                <font color="red" size="2"><b>&nbsp; 提示:*为必填项</b></font>
                            </td>
                        </tr>
                        <tr class="tablefield">
                            <td class="tablefield" >
                                拜访类型:
                            </td>
                            <td nowrap="nowrap">
                                <asp:TextBox ID="txt_description" runat="server"></asp:TextBox>
                                <br />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txt_description"
                                    runat="server" ErrorMessage="请输入类型" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="tablefield" >
                                有效:
                            </td>
                            <td nowrap="nowrap">
                                <asp:CheckBox ID="chb_Active" runat="server" />
                            </td>
                            <td class="tablefield" >
                                GPS检测时间:
                            </td>
                            <td>
                                <asp:TextBox ID="txt_gpstime" runat="server" Width="57px"></asp:TextBox>
                                秒<br />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txt_gpstime"
                                    Display="Dynamic" ValidationExpression="^-?(?:(?:60(?:\.0{1,15})?)|(?:(?:(?:1[0-7]\d)|(?:[1-9]?\d))(?:\.\d{1,15})?))$">输入错误，默认15秒</asp:RegularExpressionValidator>
                            </td>
                        </tr></table>
                        <table id="wsd_listtable" style="border:0px">
                        <tr>
                            <td colspan="6" class="tablefield">
                            
                                <asp:DataList ID="DataList1" runat="server" RepeatColumns="5" RepeatDirection="Horizontal"
                                    CellPadding="5" >
                                    
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" Text='<%# Eval("Name") %>' runat="server" />
                                        
                                    </ItemTemplate>
                                    <ItemStyle Font-Size="Small" />
                                    </asp:DataList>
                                <asp:HiddenField ID="HiddenField1" Value="|采集资产|采集KPI|采集订单|采集库存|扫描条码|扫描RFID|取消模式|采集GPS|异常情况需要拍照|采集订单需要经销商|需要拍照|配置数据|采集CPR|"
                                    runat="server" />
                                <asp:HiddenField ID="HiddenField2" runat="server" />
                            </td>
                        </tr>
                    </table>
                 
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btn_add" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="VisistTypeList" EventName="SelectedIndexChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <div style="display: none">
            <asp:Button ID="btnSave" runat="server" class="wsd_button2" Text="保存" OnClick="btnSave_Click"
                CausesValidation="true" />
        </div>
    </div>
</asp:Content>
